home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Java Primer Plus
/
Java Primer Plus (Waite Group Proess)(1996).iso
/
chapter9
/
confuse.java
next >
Wrap
Text File
|
1995-12-31
|
456b
|
26 lines
/* confuse the compiler */
class confusion {
public confusion() {};
public void nothing(char x) {System.out.println("char");}
public void nothing(short x) {System.out.println("short");}
}
class test {
public static void main (String args[]) {
confusion total = new confusion();
int x = 99; // compiler cant decide this
// byte x = 99; // this would be ok
total.nothing(x); // ambiguous
}
}